//
//  Extension+UIView.swift
//  YMSwiftUI
//
//  Created by anscen on 2022/4/26.
//

import UIKit

public extension UIView{
    class func xibName() -> String{
        let name = String(describing: self)
        return name
    }
    class func nibName() ->String {
        return xibName()
    }
    class func instanceView() -> Self{
        debugPrint(nibName())
        guard let _ = Bundle.main.url(forResource:nibName(), withExtension:"nib") else { return self.init() }
        let view = Bundle.main.loadNibNamed(nibName(), owner:self, options: nil)?.first
        return view as! Self
    }
}
